package com.googlecode.beanfiles;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Test bean with associations to other beans.
 */
public class BeanWithNestedBeans {

    protected static Log log() {
        return LogFactory.getLog(BeanWithNestedBeans.class);
    }

    SimpleBean simpleBean;
    ListPropertiedBean listBean;

    public BeanWithNestedBeans() {}

    public SimpleBean getSimpleBean() {
        return simpleBean;
    }

    public void setSimpleBean(SimpleBean simpleBean) {
        this.simpleBean = simpleBean;
    }

    public ListPropertiedBean getListBean() {
        return listBean;
    }

    public void setListBean(ListPropertiedBean listBean) {
        this.listBean = listBean;
    }

    public boolean equals(Object o) {
        BeanWithNestedBeans bean = (BeanWithNestedBeans) o;
        if (bean.getSimpleBean().equals(getSimpleBean()) &&
                bean.getListBean().equals(getListBean())) {
            return true;
        } else {
            return false;
        }
    }

}
